<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //  index  0 1 2 3 4 5 6 7 8
        var arr = [1,2,3,4,5,6,7,8,9];
        // 遍历数组，循环的次数恰好是数组的长度

        for(var index = 0; index < arr.length;index++){
            console.log('index: ' + index);
            console.log('arr[' + index + ']: ' + arr[index]);
        }


    </script>
</body>
</html>